package org.example.test.mapper;
import org.apache.ibatis.annotations.*;
import org.example.test.entity.User;
import java.util.List;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM test.sys_user")
    List<User> findAll();
    @Insert("INSERT into test.sys_user(username,password,nickname,email,phone,address)VALUES" +
            "(#{username},#{password},#{nickname},#{email},#{phone},#{address})")
    int insert(User user);
//    @Update("update test.sys_user set username=#{username},password=#{password},nickname=#{nickname},email=#{email}," +
//            "phone=#{phone},address=#{address} where id=#{id}")
    int update(User user);
@Delete("delete from test.sys_user where id = #{id}")
    Integer deleteById(@Param("id") Integer id);
}
